<template>
	<div>
		<p>tableTwo</p>
		<TableCom 
		:columns="tableData.columns" 
		:propsOptions="tableData.props" 
		:data="data1"
		></TableCom>
	</div>
</template>

<script>
import  TableCom  from '@/components/TableCom.vue';
import {tableData} from "@/js/data"
export default {
	name: 'TableTwo',
	components: {
		TableCom
	},
	props: {
	},
	data() {
		return {
			tableData:{},
			data1: [
				{
					F8975xxdx14yz: '王小明',
					F8975xxdx14y3: 18,
				},
				{
					F8975xxdx14yz: '张小刚',
					F8975xxdx14y3: 25,
				},
				{
					F8975xxdx14yz: '李小红',
					F8975xxdx14y3: 30,
				},
				{
					F8975xxdx14yz: '周小伟',
					F8975xxdx14y3: 26,
				}
			]
		}
	},
	methods:{
		changeData(){
			console.log(tableData);
			let sortOptions=JSON.parse(JSON.stringify(tableData.sort));
			for(let i = 0;i<sortOptions.length;i++){
				let item = sortOptions[i];
				for(let i = 0;i<tableData.columns.length;i++){
				let element = tableData.columns[i];
					if(item.key==element.key){
						element.sortable = true;
					}
				}
			}
		 	this.tableData=tableData;
		}
	},
	mounted(){
		
		this.changeData()
	}
}
</script>

<style>

</style>
